<?  if(ereg("editButton.php",$_SERVER['PHP_SELF'])) exit();
	echo "<script>\r";
	echo "function checkDelete(Id){\r";
	echo "confirmation=confirm(\"Are you sure to delete this record ?\");\r";
	echo "if (confirmation==true)\r";
	echo "{";
	echo "\t document.forms[0].action.value='delete';\r";
	echo "\t document.forms[0].id.value=Id;\r";
	echo "\t return true;\r";
	echo "}else{\r";
	echo "\t return false;\r";
	echo "}\r";
	echo "}\r";
	echo "function checkDelete2ID(Id,Id2){\r";
	echo "confirmation=confirm(\"Are you sure to delete this record ?\");\r";
	echo "if (confirmation==true)\r";
	echo "{";
	echo "\t document.forms[0].action.value='delete';\r";
	echo "\t document.forms[0].id.value=Id;\r";
	echo "\t document.forms[0].id2.value=Id2;\r";
	echo "\t return true;\r";
	echo "}else{\r";
	echo "\t return false;\r";
	echo "}\r";
	echo "}\r";
	echo "</script>\r";

function editButton($id){
include_once("function/functUrl.php");
$id_get=base64_decode($_GET["id"]);
$id_get=str_replace($_SERVER['PHP_SELF'],"",$id_get);
if($id_get==$id) 
{  
	$result="<img src=\"../images/@Select.gif\" width=\"20\" height=\"20\" border=\"0\" title=\"Selected edit\">";
	$result.="<a href=\"".$_SERVER['PHP_SELF']."\" onClick=\"document.forms[0].id.value=''\" title=\"Undo changes\"><img src=\"../images/@Undo.gif\" width=\"20\" height=\"20\" border=\"0\"></a>\r";
}else{
	$result="<a href=".url_parser($_SERVER['PHP_SELF'].($_SERVER['QUERY_STRING']!=""?"?".$_SERVER['QUERY_STRING']:""),"id=".base64_encode($id.$_SERVER['PHP_SELF']))." onClick=\"document.forms[0].action.value='update',document.forms[0].id.value='$id';\" ><img src=\"../images/@Edit.gif\" width=\"20\" height=\"20\" border=\"0\"  title=\"Edit record\" ></a>"; 
	$result.="<input type=\"image\" src=\"../images/@Del.gif\" width=\"20\" height=\"20\" border=\"0\" title=\"Delete record\" onClick=\"return checkDelete('$id');\">\r"; 
}
	return $result;
}

function editButton2ID($id,$id2){
include_once("function/functUrl.php");
$id_get=base64_decode($_GET["id"]);
$id_get=str_replace($_SERVER['PHP_SELF'],"",$id_get);
$id2_get=base64_decode($_GET["id2"]);
$id2_get=str_replace($_SERVER['PHP_SELF'],"",$id2_get);
if(($id_get==$id) && ($id2_get==$id2)) 
{  
	$result="<img src=\"../images/@Select.gif\" width=\"20\" height=\"20\" border=\"0\" title=\"Selected edit\">";
	$result.="<a href=\"".$_SERVER['PHP_SELF']."\" onClick=\"document.forms[0].id.value=''\" title=\"Undo changes\"><img src=\"../images/@Undo.gif\" width=\"20\" height=\"20\" border=\"0\"></a>\r";
}else{
	$result="<a href=".url_parser($_SERVER['PHP_SELF'].($_SERVER['QUERY_STRING']!=""?"?".$_SERVER['QUERY_STRING']:""),"id=".base64_encode($id.$_SERVER['PHP_SELF'])."&id2=".base64_encode($id2.$_SERVER['PHP_SELF']))." onClick=\"document.forms[0].action.value='update',document.forms[0].id.value='$id';\" ><img src=\"../images/@Edit.gif\" width=\"20\" height=\"20\" border=\"0\"  title=\"Edit record\" ></a>"; 
	$result.="<input type=\"image\" src=\"../images/@Del.gif\" width=\"20\" height=\"20\" border=\"0\" title=\"Delete record\" onClick=\"return checkDelete2ID('$id','$id2');\">\r"; 
}
	return $result;
}

function updateButton($id){
include_once("function/functUrl.php");
$id_get=base64_decode($_GET["id"]);
$id_get=str_replace($_SERVER['PHP_SELF'],"",$id_get);
if($id_get==$id) 
{  
	$result="<img src=\"../images/@Select.gif\" width=\"20\" height=\"20\" border=\"0\" title=\"Selected edit\">";
	$result.="<a href=\"".$_SERVER['PHP_SELF']."\" onClick=\"document.forms[0].id.value=''\" title=\"Undo changes\"><img src=\"../images/@Undo.gif\" width=\"20\" height=\"20\" border=\"0\"></a>\r";
}else{
	$result="<a href=".url_parser($_SERVER['PHP_SELF'].($_SERVER['QUERY_STRING']!=""?"?".$_SERVER['QUERY_STRING']:""),"id=".base64_encode($id.$_SERVER['PHP_SELF']))." onClick=\"document.forms[0].action.value='update',document.forms[0].id.value='$id';\" ><img src=\"../images/@Edit.gif\" width=\"20\" height=\"20\" border=\"0\"  title=\"Edit record\" ></a>"; 
}
	return $result;
} 

function deleteButton($id){
	$result.="<input type=\"image\" src=\"../images/@Del.gif\" width=\"20\" height=\"20\" border=\"0\" title=\"Delete record\" onClick=\"return checkDelete($id);\">\r"; 
	return $result;
}
?>